package com.ladybug.flow.modules.system.controller;

import com.ladybug.flow.common.annotation.LoginUser;
import com.ladybug.flow.common.security.dto.LoginUserDTO;
import com.ladybug.flow.common.vo.ResponseResult;
import com.ladybug.flow.modules.system.domain.entitys.SysResources;
import com.ladybug.flow.modules.system.domain.vo.MenuVO;
import com.ladybug.flow.modules.system.service.SysResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @description: 系统管理接口，包括菜单，权限的获取
* @author long
* @date 2022/10/17 16:37
* @version 1.0
*/
@RestController
@RequestMapping("/sys")
public class SystemController {

    @Autowired
    private SysResourcesService sysResourcesService;

    @RequestMapping("/menu")
    public ResponseResult menu(@LoginUser LoginUserDTO user){
        List<MenuVO> sysResourcesList = sysResourcesService.getMenu();
        return ResponseResult.success(sysResourcesList);
    }
}
